package org.kaer.election.utils;

import android.content.Context;
import android.view.inputmethod.InputMethodManager;

import org.kaer.election.ui.BaseActivity;

/**
 * Created by lizj on 2016/8/2.
 */
public class InputMethodUtils {
    public static void hideInputMethod(Context mContext) {
        InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
//得到InputMethodManager的实例
        if (imm.isActive()) {
//如果开启
            imm.hideSoftInputFromWindow(((BaseActivity)mContext).getCurrentFocus().getWindowToken(), 0);
           // imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, InputMethodManager.HIDE_NOT_ALWAYS);
        }
    }
}
